//
//  DisplayObject.h
//
//  Created by Colin Leung on 2010-05-21.
//  Copyright (c) 2010 digi3studio. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>
#import "IBitmapDrawable.h"
#import "IEventDispatcher.h"
#import "EventDispatcher.h"
#import "AccessibilityProperties.h"
#import "LoaderInfo.h"
#import "Transform.h"

@interface DisplayObject : NSObject <IBitmapDrawable, IEventDispatcher>
{
	EventDispatcher *eventBase;
	CALayer* layer;

	AccessibilityProperties* accessibilityProperties;
	float alpha;
	NSString* blendMode;
//	Shader* blendShader;
//	BOOL cacheAsBitmap;
//	Array* filters;
	float height;
	LoaderInfo* loaderInfo;
	DisplayObject* mask;
	float mouseX;
	float mouseY;
	NSString* name;
	id opaqueBackground;
	DisplayObject* parent;
	DisplayObject* root;
	float rotation;
	float rotationX;
	float rotationY;
	float rotationZ;
	CGRect scale9Grid;
	float scaleX;
	float scaleY;
	float scaleZ;
	CGRect scrollRect;
	DisplayObject* stage;
	Transform* transform;
	BOOL visible;
	float width;
	float x;
	float y;
	float z;
}

@property (readonly) CALayer *layer;

@property (retain) AccessibilityProperties* accessibilityProperties;
@property (assign) float alpha;
@property (retain) NSString* blendMode;
//@property (retain) Shader* blendShader;
//@property (assign) BOOL cacheAsBitmap;
//@property (retain) Array* filters;
@property (assign) float height;
@property (readonly) LoaderInfo* loaderInfo;
@property (retain) DisplayObject* mask;
@property (readonly) float mouseX;
@property (readonly) float mouseY;
@property (retain) NSString* name;
@property (retain) id opaqueBackground;
@property (readonly) DisplayObject* parent;
@property (readonly) DisplayObject* root;
@property (assign) float rotation;
@property (assign) float rotationX;
@property (assign) float rotationY;
@property (assign) float rotationZ;
@property (assign) CGRect scale9Grid;
@property (assign) float scaleX;
@property (assign) float scaleY;
@property (assign) float scaleZ;
@property (assign) CGRect scrollRect;
@property (readonly) DisplayObject* stage;
@property (retain) Transform* transform;
@property (assign) BOOL visible;
@property (assign) float width;
@property (assign) float x;
@property (assign) float y;
@property (assign) float z;

-(CGRect) getBounds:(DisplayObject*)_targetCoordinateSpace;
-(CGRect) getRect:(DisplayObject*)_targetCoordinateSpace;
-(CGPoint) globalToLocal:(CGPoint)_point;
//-(Vector3D*) globalToLocal3D:(CGPoint)_point;
-(BOOL) hitTestObject:(DisplayObject*)obj;
-(BOOL) hitTestPoint:(double)_x y:(double)_y;
-(BOOL) hitTestPoint:(double)_x y:(double)_y shapeFlag:(BOOL)_shapeFlag;
//-(CGPoint) local3DToGlobal:(Vector3D*)_point3d;
-(CGPoint) localToGlobal:(CGPoint)_point;

@end